package com.jiazhong.shixi.yangtong_bookstore.mapper;
import java.util.List;
import com.jiazhong.shixi.yangtong_bookstore.bean.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface BookMapper {
    @Select("select b.*,category_id as 'categoryId',image_name as 'imageName' from book b order by create_time desc limit 0,5")
    List<Book> findByFreshBook();
    @Select("select b.*,category_id as 'categoryId',image_name as 'imageName' from book b order by create_time desc")
    List<Book> findByFreshBookMore();

    @Select("select b.*,category_id as 'categoryId',image_name as 'imageName' from book b order by price asc limit 0,4")
    List<Book> findByLowerBook();
    @Select("select b.*,category_id as 'categoryId',image_name as 'imageName' from book b order by price asc")
    List<Book> findByLowerBookMore();
    @Select("select b.*,category_id as 'categoryId',image_name as 'imageName' from book b where `name` like #{name}")
    List<Book> findByLikeName(String name);
}
